package com.javase.homework.module2;

//（3）上网套餐类 特征：上网流量、每月资费 行为：显示所有套餐信息
public class NetPackage extends Package implements NetService {

    private double netFlow;


    public NetPackage(double monthCost, double netFlow) {
        super(monthCost);
        this.netFlow = netFlow;
    }

    public NetPackage() {
    }

    public double getNetFlow() {
        return netFlow;
    }

    public void setNetFlow(double netFlow) {
        this.netFlow = netFlow;
    }


    @Override
    public void show() {
        System.out.println("上网流量为" + netFlow + "G," +  "每月资费为" + getMonthCost() + "元。");
    }

    //    （2）上网服务接口 抽象方法: 参数1: 上网流量, 参数2: 手机卡类对象 让上网套餐类实现上网服务接口。
    @Override
    public void net(double netFlow, String cardType) {
        System.out.println("上网流量为" + netFlow + "G，" + "手机卡类型为" + cardType);
    }
}
